/****************************************************
          File Name:sem_close.c
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 20 Sep 2014 06:32:30 PM CST
*****************************************************/

#include"posix_ipc.h"

int main(int argc, char *argv[])
{
	Usage(argc,"/sem",argv[0],argv[1]);
	
    sem_t *sem;
    int flag=0;

    sem=sem_open(argv[1],flag);
    if(sem==SEM_FAILED)
        err("sem_open");

    if(sem_close(sem)==-1)
        err("sem_close");
    printf("closed\n");
    exit(EXIT_SUCCESS);
}
